home *** CD-ROM | disk | FTP | other *** search
/ Champak 86 / (Vol 86) My Disc.iso / Games / restaurante_1072.swf / scripts / __Packages / Waitress.as < prev   
Text File  |  2009-04-16  |  12KB  |  336 lines

  1. if(true)
  2. {
  3.    if(true)
  4.    {
  5.       ┬º┬ºpush(false);
  6.    }
  7.    if(!┬º┬ºpop())
  8.    {
  9.       if(true)
  10.       {
  11.          if(true)
  12.          {
  13.             ┬º┬ºpush(false);
  14.          }
  15.          if(!┬º┬ºpop())
  16.          {
  17.             if(!_global.Waitress)
  18.             {
  19.                _global.Waitress extends MissionItem;
  20.                var _loc2_ = _global.Waitress = function($mc)
  21.                {
  22.                   super($mc);
  23.                   this.__set__status(Waitress.STAND);
  24.                }.prototype;
  25.                _loc2_.setDirection = function(d)
  26.                {
  27.                   this.direction = d;
  28.                   this.refreshDirection();
  29.                };
  30.                _loc2_.menuService = function(t, mc)
  31.                {
  32.                   function backToKitchen()
  33.                   {
  34.                      obj._isBusy = false;
  35.                      if(!t.__get__customerLeave() && !t.__get__isNotFull())
  36.                      {
  37.                         Mission.getMission().__get__kitchen().addMenu(t);
  38.                      }
  39.                   }
  40.                   if(this.__get__isMusicing())
  41.                   {
  42.                      this.stopMusic();
  43.                   }
  44.                   var obj = this;
  45.                   this._isBusy = true;
  46.                   this.__set__status(Waitress.WALK);
  47.                   this.setPath(this.createPath(t).concat(),function()
  48.                   {
  49.                      obj.currentTable = t;
  50.                      obj.goBack(t,backToKitchen);
  51.                      if(mc)
  52.                      {
  53.                         mc.removeMovieClip();
  54.                      }
  55.                   }
  56.                   );
  57.                };
  58.                _loc2_.foodService = function(food, t)
  59.                {
  60.                   function gotFood()
  61.                   {
  62.                      food.__get__mc().removeMovieClip();
  63.                      if(t.__get__customerLeave() || t.__get__isNotFull())
  64.                      {
  65.                         delete food;
  66.                         obj._isBusy = false;
  67.                         return undefined;
  68.                      }
  69.                      obj.__set__status(Waitress.FULL);
  70.                      obj.setPath(obj.createPath(t).concat(),function()
  71.                      {
  72.                         obj.currentTable = t;
  73.                         obj._isBusy = false;
  74.                         obj.__set__status(Waitress.STAND);
  75.                         if(!t.__get__customerLeave() && !t.__get__isNotFull())
  76.                         {
  77.                            t.getFood(food);
  78.                         }
  79.                         else
  80.                         {
  81.                            delete food;
  82.                         }
  83.                      }
  84.                      );
  85.                   }
  86.                   if(this.__get__isMusicing())
  87.                   {
  88.                      this.stopMusic();
  89.                   }
  90.                   var obj = this;
  91.                   this._isBusy = true;
  92.                   if(this.currentTable == null)
  93.                   {
  94.                      gotFood();
  95.                   }
  96.                   else
  97.                   {
  98.                      this.goBack(this.currentTable,gotFood);
  99.                   }
  100.                };
  101.                _loc2_.cleanService = function(t)
  102.                {
  103.                   function backToKitchen()
  104.                   {
  105.                      obj._isBusy = false;
  106.                   }
  107.                   if(this.__get__isMusicing())
  108.                   {
  109.                      this.stopMusic();
  110.                   }
  111.                   var obj = this;
  112.                   this._isBusy = true;
  113.                   this.__set__status(Waitress.WALK);
  114.                   this.setPath(this.createPath(t).concat(),function()
  115.                   {
  116.                      obj.currentTable = t;
  117.                      t.__get__food().__get__mc().removeMovieClip();
  118.                      t.__set__status(Table.EATTED);
  119.                      obj.goBack(t,backToKitchen,Waitress.EMPTY);
  120.                   }
  121.                   );
  122.                };
  123.                _loc2_.musicService = function(t)
  124.                {
  125.                   if(this.__get__isMusicing())
  126.                   {
  127.                      this.stopMusic();
  128.                   }
  129.                   var obj = this;
  130.                   this._isBusy = true;
  131.                   this.__set__status(Waitress.WALK);
  132.                   this.setPath(this.createPath(t).concat(),function()
  133.                   {
  134.                      obj._isBusy = false;
  135.                      obj.currentTable = t;
  136.                      obj.__set__status(Waitress.MUSIC);
  137.                      t.listenMusic();
  138.                   }
  139.                   );
  140.                };
  141.                _loc2_.__get__isMusicing = function()
  142.                {
  143.                   return this.__get__status() == Waitress.MUSIC;
  144.                };
  145.                _loc2_.stopMusic = function()
  146.                {
  147.                   this.currentTable.musicStop();
  148.                };
  149.                _loc2_.__set__status = function(value)
  150.                {
  151.                   super.__set__status(value);
  152.                   this.refreshDirection();
  153.                   return this.__get__status();
  154.                };
  155.                _loc2_.__get__isBusy = function()
  156.                {
  157.                   return this._isBusy;
  158.                };
  159.                _loc2_.__get__bornPoint = function()
  160.                {
  161.                   return MissionData.DATA[Mission.getMission().__get__id()].waitress.bornPoint;
  162.                };
  163.                _loc2_.__get__rendezvousPoint = function()
  164.                {
  165.                   return MissionData.DATA[Mission.getMission().__get__id()].waitress.rendezous;
  166.                };
  167.                _loc2_.createPath = function(t)
  168.                {
  169.                   if(this.currentTable == t)
  170.                   {
  171.                      return [];
  172.                   }
  173.                   var _loc2_ = undefined;
  174.                   if(this.currentTable == null)
  175.                   {
  176.                      _loc2_ = PathFinding.getPathToTable(t);
  177.                   }
  178.                   else
  179.                   {
  180.                      _loc2_ = PathFinding.getPathBetweenTables(this.currentTable,t);
  181.                   }
  182.                   return _loc2_;
  183.                };
  184.                _loc2_.createBackPath = function(t)
  185.                {
  186.                   if(this.currentTable == null)
  187.                   {
  188.                      return [];
  189.                   }
  190.                   var _loc2_ = PathFinding.getPathFromTable(t);
  191.                   return _loc2_;
  192.                };
  193.                _loc2_.addPointToPath = function(p, path)
  194.                {
  195.                   var _loc2_ = path[path.length - 1];
  196.                   var _loc1_ = p;
  197.                   if(_loc2_.x == _loc1_.x && _loc2_.y == _loc1_.y)
  198.                   {
  199.                      return undefined;
  200.                   }
  201.                   if(_loc2_.x == _loc1_.x || _loc2_.y == _loc1_.y)
  202.                   {
  203.                      path.push(p);
  204.                   }
  205.                   else
  206.                   {
  207.                      path.push({x:_loc1_.x,y:_loc2_.y});
  208.                      path.push(p);
  209.                   }
  210.                };
  211.                _loc2_.goBack = function(t, callBack, s)
  212.                {
  213.                   this.__set__status(!s ? Waitress.WALK : s);
  214.                   var obj = this;
  215.                   this.setPath(this.createBackPath(t),function()
  216.                   {
  217.                      obj.currentTable = null;
  218.                      obj.__set__status(Waitress.STAND);
  219.                      callBack();
  220.                   }
  221.                   );
  222.                };
  223.                _loc2_.refreshDirection = function()
  224.                {
  225.                   this.__get__mc()[this.__get__status()].gotoAndStop(this.direction);
  226.                };
  227.                _loc2_.setPath = function(path, endHandle)
  228.                {
  229.                   if(path.length == 0)
  230.                   {
  231.                      this.tween.onMotionFinished = null;
  232.                      this.tween.onMotionChanged = null;
  233.                      this.tween = null;
  234.                      endHandle();
  235.                      return undefined;
  236.                   }
  237.                   var obj = this;
  238.                   var _loc2_ = path.shift();
  239.                   var _loc3_ = Math.sqrt((_loc2_.x - this.__get__mc()._x) * (_loc2_.x - this.__get__mc()._x) + (_loc2_.y - this.__get__mc()._y) * (_loc2_.y - this.__get__mc()._y)) / this.v;
  240.                   if(_loc2_.x > this.__get__mc()._x)
  241.                   {
  242.                      if(_loc2_.y > this.__get__mc()._y)
  243.                      {
  244.                         this.setDirection(Direction.FACE);
  245.                      }
  246.                      else
  247.                      {
  248.                         this.setDirection(Direction.RIGHT);
  249.                      }
  250.                   }
  251.                   else if(_loc2_.y > this.__get__mc()._y)
  252.                   {
  253.                      this.setDirection(Direction.LEFT);
  254.                   }
  255.                   else
  256.                   {
  257.                      this.setDirection(Direction.BACK);
  258.                   }
  259.                   this.tween = new mx.transitions.Tween(this.__get__mc(),"_y",mx.transitions.easing.None.easeOut,this.__get__mc()._y,_loc2_.y,_loc3_,true);
  260.                   new mx.transitions.Tween(this.__get__mc(),"_x",mx.transitions.easing.None.easeOut,this.__get__mc()._x,_loc2_.x,_loc3_,true);
  261.                   this.tween.onMotionFinished = function()
  262.                   {
  263.                      obj.setPath(path,endHandle);
  264.                   };
  265.                   this.tween.onMotionChanged = function()
  266.                   {
  267.                      Mission.getMission().refreshDepth();
  268.                   };
  269.                };
  270.                _global.Waitress = function($mc)
  271.                {
  272.                   super($mc);
  273.                   this.__set__status(Waitress.STAND);
  274.                }.STATUSCHANGEDEVENT = "waitressStatusChangedHandle";
  275.                _global.Waitress = function($mc)
  276.                {
  277.                   super($mc);
  278.                   this.__set__status(Waitress.STAND);
  279.                }.STAND = "stand";
  280.                _global.Waitress = function($mc)
  281.                {
  282.                   super($mc);
  283.                   this.__set__status(Waitress.STAND);
  284.                }.WALK = "walk";
  285.                _global.Waitress = function($mc)
  286.                {
  287.                   super($mc);
  288.                   this.__set__status(Waitress.STAND);
  289.                }.FULL = "full";
  290.                _global.Waitress = function($mc)
  291.                {
  292.                   super($mc);
  293.                   this.__set__status(Waitress.STAND);
  294.                }.EMPTY = "empty";
  295.                _global.Waitress = function($mc)
  296.                {
  297.                   super($mc);
  298.                   this.__set__status(Waitress.STAND);
  299.                }.MUSIC = "music";
  300.                _loc2_.direction = 1;
  301.                _loc2_.v = 200;
  302.                _loc2_._isBusy = false;
  303.                _loc2_.currentTable = null;
  304.                ┬º┬ºpush(_loc2_.addProperty("bornPoint",_loc2_.__get__bornPoint,function()
  305.                {
  306.                }
  307.                ));
  308.                ┬º┬ºpush(_loc2_.addProperty("isBusy",_loc2_.__get__isBusy,function()
  309.                {
  310.                }
  311.                ));
  312.                ┬º┬ºpush(_loc2_.addProperty("isMusicing",_loc2_.__get__isMusicing,function()
  313.                {
  314.                }
  315.                ));
  316.                ┬º┬ºpush(_loc2_.addProperty("rendezvousPoint",_loc2_.__get__rendezvousPoint,function()
  317.                {
  318.                }
  319.                ));
  320.                ┬º┬ºpush(_loc2_.addProperty("status",function()
  321.                {
  322.                }
  323.                ,_loc2_.__set__status));
  324.                ┬º┬ºpush(ASSetPropFlags(_global.Waitress.prototype,null,1));
  325.             }
  326.             ┬º┬ºpop();
  327.          }
  328.       }
  329.       ┬º┬ºgoto(addr934);
  330.    }
  331.    ┬º┬ºpush(function ┬º\x1b∩┐╜\x02┬º(┬º∩┐╜\x07┬º, ┬º\x01┬º, ┬º\x02\x01┬º, ┬º\x01┬º, ┬º∩┐╜∩┐╜∩┐╜\x03∩┐╜∩┐╜\x03g┬º, _global, Waitress, STAND, __set__status, MissionItem, prototype, setDirection, direction, refreshDirection)
  332.    {
  333.    } - 1);
  334. }
  335. addr934:
  336.